home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / SoundAndMusic / cmix / lib / bpluck.c < prev    next >
Text File  |  1990-05-07  |  379b  |  20 lines

  1. float bpluck(xin,q)
  2. float xin,*q; 
  3. {
  4.     float temp;
  5.     int ip;
  6.     q[0]++;
  7.     if(*q <= q[1]) ip = *q;
  8.     else {
  9.         *q = ip = 20;
  10.         q[ip] = q[11];  /* reseed for bowed effect */
  11.          }
  12.     q[7] = (1.-q[8]) * q[ip] + q[8] * q[7];
  13.     temp = q[9] * (q[2] * q[ip] + q[3] * q[6]);
  14.     q[6] = q[ip];
  15.     q[ip] = q[10] * temp + q[4] - q[10] * q[5];
  16.     q[5] = q[ip] = xin + q[ip];
  17.     q[4] = temp;
  18.     return(q[7]);
  19. }
  20.